import request from "@/utils/request";

// 查询优惠券列表
export function listCoupon(query) {
  return request({
    url: "/business/coupon/list",
    method: "get",
    params: query,
  });
}

// 查询优惠券所有列表
export function listAllCoupon(query) {
  return request({
    url: "/business/coupon/listAll",
    method: "get",
    params: query,
  });
}

// 查询优惠券详细
export function getCoupon(id) {
  return request({
    url: "/business/coupon/getInfo/" + id,
    method: "get",
  });
}

// 新增优惠券
export function addCoupon(data) {
  return request({
    url: "/business/coupon/add",
    method: "post",
    data: data,
  });
}

// 修改优惠券
export function updateCoupon(data) {
  return request({
    url: "/business/coupon/edit",
    method: "post",
    data: data,
  });
}

// 删除优惠券
export function delCoupon(id) {
  return request({
    url: "/business/coupon/remove/" + id,
    method: "get",
  });
}

// 发布优惠券
export function addCouponfb(data) {
  return request({
    url: "/business/couponIssue/add",
    method: "post",
    data: data,
  });
}
